Hi SJH,
Such a mechanism already exists. I'm not sure why it isn't
working for you. See the function:
int CKMotionIO::FlushInputBuffer()
Sending an 0x03 character to KFLOP should immediately cause it to
discard all data in its input buffers and respond with 3
characters:\
ESC C \r
After any interrupted communication or data corruption calling
the function:
int CKMotionDLL::Failed()
Should cause the interface to flush and reset before the next
interaction.
HTH
Regards
TK
Hi Tom,
One of the frustrations we have trying to get rock
solid connections from the pc to the kflop is that
if something crashes (on the host), the kflop
sometimes is left in the middle of a transaction
or is otherwise unable to sync up. When the PC
side is restarted, it cannot resync. I just shut
everything down then try again, but we don't want
our customers to have to do this. Bad enough when
our software crashes, but really bad if it can't
just start up again.
Maybe this is a bug in our KMotionServer
implementation, but it would be nice if, when
opening the USB connection, the server could send
out some binary sequence that the kflop is
guaranteed to accept and cause it to reset its USB
comms state machine.
For example, we could send out null characters (0x00)
until the kflop responds with a null. Then we would
know we're in sync. Or maybe we just send out a null
after opening the usb device and hope for the best.
Regards,
SJH